package com.hnkywl.sts.util;

import java.util.Calendar;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: nianjunyan
 * Date: 13-4-25
 * Time: 上午9:48
 * To change this template use File | Settings | File Templates.
 */
public class Constant {
    /*选项类型*/

    // 文本
    public static int XXLX_TEXT = 1;

    // 数据字典
    public static int XXLX_DATA = 2;

    // 数据集
    public static int XXLX_DATASET = 3;

    //日期
    public static int XXLX_DATE = 4;

    // 固定下拉
    public static int XXLX_DROPDOWN = 5;

    // 表格
    public static int XXLX_TABLE = 6;

    /*合同类型*/

    // 销售合同
    public  static  String HT_XSHT = "xsht";

    // 采购合同
    public static  String HT_CGHT="cght";

    // 系统当前时间
    public  static  String CURRENT_DATE="sysdate";

    public static void main(String[] args){
        java.text.DecimalFormat df = new java.text.DecimalFormat("#0.0000");
        String hsj = df.format(3600.0000 * (1 + 1.5000 / 100));
        System.out.println(Double.parseDouble(hsj));
    }

    //   当前日期加减n天后的日期，返回String   (yyyy-mm-dd)
    public static Date jDaysAfterNowDate(Date date) {
        Calendar rightNow = Calendar.getInstance();
        rightNow.setTime(date);
        rightNow.set(java.util.Calendar.HOUR_OF_DAY, 23);
        rightNow.set(java.util.Calendar.MINUTE, 59);
        rightNow.set(java.util.Calendar.SECOND, 59);
        return rightNow.getTime();
    }

    //   当前日期加减n天后的日期，返回String   (yyyy-mm-dd)
    public static Date sDaysAfterNowDate(Date date) {
        Calendar rightNow = Calendar.getInstance();
        rightNow.setTime(date);
        rightNow.set(java.util.Calendar.HOUR_OF_DAY, 0);
        rightNow.set(java.util.Calendar.MINUTE, 0);
        rightNow.set(java.util.Calendar.SECOND, 0);
        return rightNow.getTime();
    }
}
